﻿/*
 * 文件名称：
 * 程序员：huangsb
 * 创建时间：2008/05/20
 * 
 * 功能说明：角色列表
 * 
 * 修改人员：
 * 
 * 修改日期：
 * 
 * 修改记录：
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Whir.Common.WebHelper;

public partial class Whir_System_Module_Role_RoleList : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        RoleHelper.IsLogin();    //登录判断
        if (RoleHelper.AdminCache.typeID != 1)
        {
            JsHelper.redirect(Page, "当前用户不是管理员，无法继续操作！", "../../Main.aspx");
        }

        if (!IsPostBack)
        {
            BindData();
        }
    }

    protected void BindData()
    {
        this.rRole.DataSource = Whir.SQLServerDAL.DbHelperSQL.GetDataTable("*","Whir_AdminRole","", "");
        this.rRole.DataBind();
    }

    //删除
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        LinkButton lbn = sender as LinkButton;

        //修改帐号表
        RoleHelper.UpdateRoleIDs(lbn.CommandArgument);

        new Whir.SQLServerDAL.Whir_AdminRole().Delete(int.Parse(lbn.CommandArgument));

        BindData();
    }
}
